<?php
$site = $_REQUEST['sitename'];
if ($site == 'www.google.fr'){
//$language = $_REQUEST['language'];
$language = $_COOKIE['think_language'];
$merNo = $_REQUEST['merNo'];
$gatewayNo = $_REQUEST['gatewayNo'];
$signInfo = $_REQUEST['signInfo'];
$paymentMethod = $_REQUEST['paymentMethod'];
$orderCurrency = $_REQUEST['orderCurrency'];
$orderNo = $_REQUEST['orderNo'];
$orderAmount = $_REQUEST['orderAmount'];
$returnUrl = $_REQUEST['returnUrl'];
$remark = $_REQUEST['remark'];
$firstName = $_REQUEST['firstName'];
$lastName = $_REQUEST['lastName'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$country = $_REQUEST['country'];
$state = $_REQUEST['state'];
$city = $_REQUEST['city'];
$address = $_REQUEST['address'];
$zip = $_REQUEST['zip'];
if($language){
	/*if($language == 'EN')
		$languages = 'en-us';
	elseif($language == 'FR') 
		$languages = 'fr';*/
	
	$langs = (array)json_decode(file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/index/lang/name/'.$language.''));
}else{
	$langs = (array)json_decode(file_get_contents('http://'.$_SERVER['HTTP_HOST'].'/index/lang/'));
}

$txtorderinfo		=$langs['orderdetailed'];
$txtorderon			=$langs['_THE_ORDER_NUMBER_IS_'];
$txtorderbz			=$langs['currency'];
$txtorderamount		=$langs['recharge_ampount'];
$txtbillinfo		=$langs['delivery_billing_info']; 
$txtbillfname		=$langs['fristname'];
$txtbilllname		=$langs['lastname'];
$txtbilladdress		=$langs['address'];
$txtbillcountry		=$langs['couny'];
$txtbillselect		=$langs['xuanze'];
$txtbillstate		=$langs['state'];
$txtbillcity		=$langs['city'];
$txtbillzip			=$langs['postcode'];  
$txtbillemail		=$langs['email'];
$txtbillphone		=$langs['userphone'];
$txtbillchange		=$langs['edit_address'];
$txtconfim			=$langs['saveuser'];
$txtcancel			=$langs['cancel'];
$txtusexyk			=$langs['payment_info'];


$jspush = 'var consignee_not_null = "'.$langs['input_contact_name'].'";'."\n";
$jspush .= 'var consignee_not_righ = " Name:Please input between 2-500 characters only!";'."\n";
$jspush .= 'var address_not_null = "'.$langs['inputaddress'].'";'."\n";
$jspush .= 'var address_not_righ = " Address:Please input between 2-500 characters only!";'."\n";
$jspush .= 'var country_not_null = "'.$langs['choosecountry'].'";'."\n";
$jspush .= 'var province_not_null = "'.$langs['inputstate'].'";'."\n";
$jspush .= 'var city_not_null = "'.$langs['inputcity'].'";'."\n";
$jspush .= 'var city_not_righ = " City:Please input between 2-100 characters only!";'."\n";
$jspush .= 'var zip_not_num = "'.$langs['inputpostcode'].'";'."\n";
$jspush .= 'var invalid_email = "'.$langs['inputemail'].'";'."\n";
$jspush .= 'var tele_not_null = "'.$langs['inputphone'].'";'."\n";
$jspush .= 'var tele_invaild = "Please enter valid phone No.";'."\n";
		
function real_ip()
{
    static $realip = NULL;

    if ($realip !== NULL)
    {
        return $realip;
    }

    if (isset($_SERVER))
    {
        if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
        {
            $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);

            /* 取X-Forwarded-For中第一个非unknown的有效IP字符串 */
            foreach ($arr AS $ip)
            {
                $ip = trim($ip);

                if ($ip != 'unknown')
                {
                    $realip = $ip;

                    break;
                }
            }
        }
        elseif (isset($_SERVER['HTTP_CLIENT_IP']))
        {
            $realip = $_SERVER['HTTP_CLIENT_IP'];
        }
        else
        {
            if (isset($_SERVER['REMOTE_ADDR']))
            {
                $realip = $_SERVER['REMOTE_ADDR'];
            }
            else
            {
                $realip = '0.0.0.0';
            }
        }
    }
    else
    {
        if (getenv('HTTP_X_FORWARDED_FOR'))
        {
            $realip = getenv('HTTP_X_FORWARDED_FOR');
        }
        elseif (getenv('HTTP_CLIENT_IP'))
        {
            $realip = getenv('HTTP_CLIENT_IP');
        }
        else
        {
            $realip = getenv('REMOTE_ADDR');
        }
    }

    preg_match("/[\d\.]{7,15}/", $realip, $onlineip);
    $realip = !empty($onlineip[0]) ? $onlineip[0] : '0.0.0.0';

    return $realip;
}

$real_ip = real_ip();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>VisaBill</title>
<style type="text/css">
body{margin-right: auto;margin-left: auto; width:800px;font-size: 12px;font-family: tahoma, arial;background: #fff;}
table{width: 100%;}
table th {width:100%;font-size: 18px;}
table th,table td{ padding:5px;}
table td.frist {width:35%;text-align:right;}
table td.other {width:65%;font-size: 18px;}
div.datagrid_div{width: 100%;border: 1px solid #EEEEEE;}
table.datagrid3{border-collapse: separate;background: #ffffff;}
table.datagrid3 th{text-align: left;background: #EDECE7;padding: 5px;border: 0px solid #fff;}
table.datagrid3 td{padding: 5px;border: 0px solid #fff; background:#ffffff;}
.orderMsg{ position:absolute; background:#fff; border:1px solid #939395; width:800px; height:500px; overflow:hidden; z-index:99999; font-size:14px; color:#000; left:0; top:0; display:none;}
input{ padding:2px 8px 0pt 3px; border:1px solid #CCC; background-color:#FFF; }
select{ padding:2px 8px 0pt 3px; border:1px solid #CCC; background-color:#FFF; }
.input_on{ padding:2px 8px 0pt 3px; border:1px solid #999; background-color:#EDECE7; } 
.input_off{ padding:2px 8px 0pt 3px; border:1px solid #CCC; background-color:#FFF; } 
.input_move{ padding:2px 8px 0pt 3px; border:1px solid #999; background-color:#EDECE7; } 

input[type="submit"] {
    -moz-user-select: none;
    background-color: #F5F5F5;
    background-image: -moz-linear-gradient(center top , #F5F5F5, #F1F1F1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2px 2px 2px 2px;
    color: #666666;
    cursor: default;
    font-family: arial,sans-serif;
    font-size: 11px;
    font-weight: bold;
    height: 29px;
    line-height: 27px;
    margin: 11px 6px;
    min-width: 54px;
    padding: 0 8px;
    text-align: center;
}
input[type="submit"]:hover {
    background-color: #F8F8F8;
    background-image: -moz-linear-gradient(center top , #F8F8F8, #F1F1F1);
    border: 1px solid #C6C6C6;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    color: #333333;
}
input[type="submit"]:focus {
    border: 1px solid #4D90FE;
    outline: medium none;
}

input[type="button"] {
    -moz-user-select: none;
    background-color: #F5F5F5;
    background-image: -moz-linear-gradient(center top , #F5F5F5, #F1F1F1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2px 2px 2px 2px;
    color: #666666;
    cursor: default;
    font-family: arial,sans-serif;
    font-size: 11px;
    font-weight: bold;
    height: 29px;
    line-height: 27px;
    margin: 11px 6px;
    min-width: 54px;
    padding: 0 8px;
    text-align: center;
}
input[type="button"]:hover {
    background-color: #F8F8F8;
    background-image: -moz-linear-gradient(center top , #F8F8F8, #F1F1F1);
    border: 1px solid #C6C6C6;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    color: #333333;
}
input[type="button"]:focus {
    border: 1px solid #4D90FE;
    outline: medium none;
}
</style>
<script type="text/javascript">
var Utils = new Object();

Utils.htmlEncode = function(text)
{
  return text.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}

Utils.trim = function( text )
{
  if (typeof(text) == "string")
  {
    return text.replace(/^\s*|\s*$/g, "");
  }
  else
  {
    return text;
  }
}

Utils.isEmpty = function( val )
{
  switch (typeof(val))
  {
    case 'string':
      return Utils.trim(val).length == 0 ? true : false;
      break;
    case 'number':
      return val == 0;
      break;
    case 'object':
      return val == null;
      break;
    case 'array':
      return val.length == 0;
      break;
    default:
      return true;
  }
}

Utils.isZipCode = function(val)
{
  var reg = /^[A-Za-z0-9]+$/;
  return reg.test(val);
}

Utils.isEmail = function( email )
{
  var reg1 = /([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)/;

  return reg1.test( email );
}

Utils.isTel = function ( tel )
{
  var reg = /^[\d|\-|\s|\_]+$/;

  return reg.test( tel );
}


function checkConsignee(frm)
{
  var msg = new Array();
  var err = false;


  if (Utils.isEmpty(frm.elements['firstName'].value))
  {
    err = true;
    msg.push(consignee_not_null);
  }
  else
  {
    if (document.theForm.firstName.value.length < 2)
    {
      err = true;
      msg.push(consignee_not_righ);
    }
  }

  if (Utils.isEmpty(frm.elements['lastName'].value))
  {
    err = true;
    msg.push(consignee_not_null);
  }
    else
  {
    if (document.theForm.lastName.value.length < 2)
    {
      err = true;
      msg.push(consignee_not_righ);
    }
  }

  if (frm.elements['address'] && Utils.isEmpty(frm.elements['address'].value))
  {
    err = true;
    msg.push(address_not_null);
  }
    else
  {
    if (document.theForm.address.value.length < 2)
    {
      err = true;
      msg.push(address_not_righ);
    }
  }

  if (frm.elements['country'] && frm.elements['country'].value == 0)
  {
    msg.push(country_not_null);
    err = true;
  }

  if (frm.elements['state'] && frm.elements['state'].value == 0 && frm.elements['state'].length > 1)
  {
    err = true;
    msg.push(province_not_null);
  }

  if (frm.elements['city'] && frm.elements['city'].value == 0)
  {
    err = true;
    msg.push(city_not_null);
  }
      else
  {
    if (document.theForm.city.value.length < 2)
    {
      err = true;
      msg.push(city_not_righ);
    }
  }

  if (Utils.isEmpty(frm.elements['zip'].value))
  {
    err = true;
    msg.push(zip_not_num);
  }
  else
  {
    if (!Utils.isZipCode(frm.elements['zip'].value))
    {
      err = true;
      msg.push(zip_not_num);
    }
  }


  if ( ! Utils.isEmail(frm.elements['email'].value))
  {
    err = true;
    msg.push(invalid_email);
  }

  if (Utils.isEmpty(frm.elements['phone'].value))
  {
    err = true;
    msg.push(tele_not_null);
  }
  else
  {
    if (!Utils.isTel(frm.elements['phone'].value))
    {
      err = true;
      msg.push(tele_invaild);
    }
  }

  if (err)
  {
    message = msg.join("\n");
    alert(message);
  }
  return ! err;
}
</script>
</head>

<body>
<script type="text/javascript">
    function killOrder(btn) {
		var isIe = (document.all) ? true: false;
		var orderMsg = document.getElementById("orderMsg");
        var w = document.body.clientWidth;
        var h = document.body.clientHeight;
		var h1 = document.documentElement.clientHeight;
		var styleStr = "top:0px;left:0px;position:absolute;z-index:999;background:#666;width:100%;height:960px;";
        styleStr += (isIe) ? "filter:alpha(opacity=80);": "opacity:0.8;";
		var styleStr1 = "display:block;left:" + 50 + "%;top:" + (h1 / 2 - 200) + "px;margin-left:" + (-400) + "px;";
		var shadowDiv = document.createElement("div");
		if (!btn) {
            shadowDiv.style.cssText = styleStr;
            shadowDiv.id = "shadowDiv";
            document.body.insertBefore(shadowDiv, document.body.lastChild);
            orderMsg.style.cssText = styleStr1;
        }else{
            if (document.getElementById("shadowDiv")) {
                document.body.removeChild(document.getElementById("shadowDiv"));
                orderMsg.style.cssText = "display:none;";
            }
        }
	}
</script>

<h3>
  <a href="/">
    <img src="/web/Tpl/default/images/logo.png" width="200" height="29" />
  </a>
</h3>
<div class="datagrid_div">
  <table class="datagrid3">
    <tr>
      <th colspan="2"><?php echo $txtorderinfo ?></th>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtorderon ?></td><td class="other"><font color="#B22410"><?php echo $orderNo ?></font></td>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtorderbz ?></td><td class="other"><font color="#B22410"><?php echo $orderCurrency ?></font></td>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtorderamount ?></td><td class="other"><font color="#B22410"><?php echo $orderAmount ?></font></td>
    </tr>
  </table>
</div>
<br />
<div class="datagrid_div">
  <table class="datagrid3">
    <tr>
      <th colspan="2"><?php echo $txtbillinfo ?></th>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtbillfname." / ".$txtbilllname ?></td><td><?php echo $firstName." / ".$lastName ?></td>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtbilladdress ?></td><td><?php echo $address ?></td>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtbillcountry ?></td><td><?php if($country==fr){ echo("France. Metropolitan");}else{ echo $country;} ?></td>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtbillstate ?></td><td><?php echo $state ?></td>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtbillcity ?></td><td><?php echo $city ?></td>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtbillzip ?></td><td><?php echo $zip ?></td>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtbillemail ?></td><td><?php echo $email ?></td>
    </tr>
    <tr>
      <td class="frist" ><?php echo $txtbillphone ?></td><td><?php echo $phone ?></td>
    </tr>
    <tr>
      <td colspan="2"><a href="#" onclick="killOrder()"><?php echo $txtbillchange ?></a></td>
    </tr>
  </table>
</div>

<br />

<div class="datagrid_div">
  <table class="datagrid3">
    <tr>
      <th><?php echo $txtusexyk ?></th>
    </tr>
    <tr>
      <td class="frist" >
<script type="text/javascript">
datestart=new Date().getTime() ;
</script>
<?php
//$target="https://payment.secure-checkoutserver.com/Interface";
$target="https://payment.globebill.com/Interface";	//2014-02-21更换新网关
$def_url  = '<form name="globebill_checkout"   method="post" action="'.$target.'" target="_parent">';
$def_url .= '<input type="hidden" name="merNo" value="'.$merNo.'"/>';
$def_url .= '<input type="hidden" name="gatewayNo" value="'.$gatewayNo.'"/>';
$def_url .= '<input type="hidden" name="orderCurrency" value="'.$orderCurrency.'"/>';
$def_url .= '<input type="hidden" name="orderNo" value="'.$orderNo.'"/>';
$def_url .= '<input type="hidden" name="orderAmount" value="'.$orderAmount.'"/>';
$def_url .= '<input type="hidden" name="returnUrl" value="'.$returnUrl.'"/>';
$def_url .= '<input type="hidden" name="signInfo" value="'.$signInfo.'"/>';
$def_url .= '<input type="hidden" name="remark" value="'.$remark.'"/>';
$def_url .= '<input type="hidden" name="firstName" value="'.$firstName.'"/>';
$def_url .= '<input type="hidden" name="lastName" value="'.$lastName.'"/>';
$def_url .= '<input type="hidden" name="email" value="'.$email.'"/>';
$def_url .= '<input type="hidden" name="phone" value="'.$phone.'"/>';
$def_url .= '<input type="hidden" name="paymentMethod" value="'.$paymentMethod.'"/>';
$def_url .= '<input type="hidden" name="country" value="'.$country.'"/>';
$def_url .= '<input type="hidden" name="state" value="'.$state.'"/>';
$def_url .= '<input type="hidden" name="city" value="'.$city.'"/>';
$def_url .= '<input type="hidden" name="address" value="'.$address.'"/>';
$def_url .= '<input type="hidden" name="zip" value="'.$zip.'"/>';
$def_url .= '</form>';
$def_url .= '<iframe width="695px" height="400px" scrolling="no" style="border:none; margin: 0 auto; overflow:hidden;" id="ifrm_globebill_checkout" name="ifrm_globebill_checkout"></iframe>' . "\n";
echo $def_url;
?>


<script type="text/javascript">
var iframe = document.getElementById("ifrm_globebill_checkout");
if (iframe.attachEvent){
    iframe.attachEvent("onload", function(){
        dateend = new Date().getTime() ;
		var onloadtime = dateend-datestart;
		//document.getElementById('showtime').innerHTML = onloadtime + 'ms';
//<!--back data to gateway -->
if(window.XMLHttpRequest) {
	xHRObject  = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
	try {
			xHRObject  = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xHRObject  = new ActiveXObject("Microsoft.XMLHTTP");
		}catch (e) {}
	}
}
xHRObject.open("GET", "/visabillonloadtime.php?num=<?php echo $orderNo ?>&realip=<?php echo $real_ip ?>&loadtime=" + onloadtime, true);
xHRObject.send(null);
//<!--end -->
    });
} else {
    iframe.onload = function(){
        dateend = new Date().getTime() ;
		var onloadtime = dateend-datestart;
		//document.getElementById('showtime').innerHTML = onloadtime + 'ms';
//<!--back data to gateway -->
if(window.XMLHttpRequest) {
	xHRObject  = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
	try {
			xHRObject  = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xHRObject  = new ActiveXObject("Microsoft.XMLHTTP");
		}catch (e) {}
	}
}
xHRObject.open("GET", "/visabillonloadtime.php?num=<?php echo $orderNo ?>&realip=<?php echo $real_ip ?>&loadtime=" + onloadtime, true);
xHRObject.send(null);
//<!--end -->
    };
}

//document.body.appendChild(iframe);
</script>


<script type="text/javascript">
if (window.XMLHttpRequest) {
document.globebill_checkout.target="ifrm_globebill_checkout";
}
document.globebill_checkout.action="https://payment.globebill.com/Interface";
document.globebill_checkout.submit();
window.status = "https://payment.globebill.com/Interface";
</script>
					</td>
				</tr>
		</table>
	</div>
<br />

<div id="orderMsg" class="orderMsg">
<script type="text/javascript">
	<?php echo $jspush ?>
    onload = function() {
		if (!document.all){
			document.forms['theForm'].reset();
		}
    }
     
</script>
<form method="post" action="visabillgateway.php" target="_parent" name="theForm" id="theForm" onsubmit="return checkConsignee(this)">
<table border="0" class="datagrid3">
  <tr>
	<th colspan="2"><?php echo $txtbillchange ?></th>
  </tr>
  <tr>
  <td colspan="2"></td>
  </tr>
  <tr>
  <td colspan="2"></td>
  </tr>
  <tr>
  <td colspan="2"></td>
  </tr>
  <tr>
  <td colspan="2"></td>
  </tr>
  <tr>
    <td class="frist" ><?php echo ($txtbillfname." / ".$txtbilllname) ?></td>
    <td><input name="firstName" class="input_out"  type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"  size="10" value="<?php echo $firstName ?>" /> 
	<input name="lastName" class="input_out"  type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" size="10" value="<?php echo $lastName ?>" /></td>

  </tr>
  <tr>
    <td class="frist" ><?php echo $txtbilladdress ?></td>
    <td><input name="address" class="input_out"  type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" size="30" value="<?php echo $address ?>" /></td>

  </tr>
  <tr>
    <td class="frist" ><?php echo $txtbillcountry ?></td>
    <td><select name="country" class="input_out"  type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'"  >
	 <option value="0"><?php echo $txtbillselect ?>...</option>
                <option <?php if($country==ar) echo("selected");?> value="ar" >Argentina</option>
                <option <?php if($country==au) echo("selected");?> value="au" >Australia</option>
                <option <?php if($country==at) echo("selected");?> value="at" >Austria</option>
                <option <?php if($country==be) echo("selected");?> value="be" >Belgium</option>
                <option <?php if($country==br) echo("selected");?> value="br" >Brazil</option>
                <option <?php if($country==ca) echo("selected");?> value="ca" >Canada</option>
                <option <?php if($country==co) echo("selected");?> value="co" >Colombia</option>
                <option <?php if($country==dk) echo("selected");?> value="dk" >Denmark</option>
                <option <?php if($country==fi) echo("selected");?> value="fi" >Finland</option>
                <option <?php if($country==fr) echo("selected");?> value="fr" >France. Metropolitan</option>
                <option <?php if($country==de) echo("selected");?> value="de" >Germany</option>
                <option <?php if($country==gr) echo("selected");?> value="gr" >Greece</option>
                <option <?php if($country==ir) echo("selected");?> value="ir" >Iran</option>
                <option <?php if($country==ie) echo("selected");?> value="ie" >Ireland</option>
                <option <?php if($country==it) echo("selected");?> value="it" >ITALY</option>
                <option <?php if($country==lu) echo("selected");?> value="lu" >Luxembourg</option>
                <option <?php if($country==mg) echo("selected");?> value="mg" >Madagascar</option>
                <option <?php if($country==mt) echo("selected");?> value="mt" >Malta</option>
                <option <?php if($country==mx) echo("selected");?> value="mx" >Mexico</option>
                <option <?php if($country==ma) echo("selected");?> value="ma" >Morocco</option>
                <option <?php if($country==nl) echo("selected");?> value="nl" >Netherlands</option>
                <option <?php if($country==ng) echo("selected");?> value="ng" >Nigeria</option>
                <option <?php if($country==no) echo("selected");?> value="no" >Norway</option>
                <option <?php if($country==pe) echo("selected");?> value="pe" >Peru</option>
                <option <?php if($country==pt) echo("selected");?> value="pt" >Portugal</option>
                <option <?php if($country==sn) echo("selected");?> value="sn" >Senegal</option>
                <option <?php if($country==es) echo("selected");?> value="es" >Spain</option>
                <option <?php if($country==se) echo("selected");?> value="se" >Sweden</option>
                <option <?php if($country==ch) echo("selected");?> value="ch" >Switzerland</option>
                <option <?php if($country==sy) echo("selected");?> value="sy" >Syria</option>
                <option <?php if($country==tn) echo("selected");?> value="tn" >Tunisia</option>
                <option <?php if($country==tr) echo("selected");?> value="tr" >Turkey</option>
                <option <?php if($country==se) echo("selected");?> value="se" >U.A.E</option>
                <option <?php if($country==gb) echo("selected");?> value="gb" >U.K</option>
                <option <?php if($country==us) echo("selected");?> value="us" >U.S.A</option>
              </select>
	</td>
  </tr>
  <tr>
    <td class="frist" ><?php echo $txtbillstate ?></td>
    <td><input name="state" class="input_out"  type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" size="20" value="<?php echo $state ?>" /></td>

  </tr>
  <tr>
    <td class="frist" ><?php echo $txtbillcity ?></td>
    <td><input name="city" class="input_out"  type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" size="20" value="<?php echo $city ?>" /></td>

  </tr>
  <tr>
    <td class="frist" ><?php echo $txtbillzip ?></td>
    <td><input name="zip" class="input_out"  type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" size="20" value="<?php echo $zip ?>" /></td>

  </tr>
  <tr>
    <td class="frist" ><?php echo $txtbillemail ?></td>
    <td><input name="email" class="input_out"  type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" size="20" value="<?php echo $email ?>" /></td>

  </tr>
  <tr>
    <td class="frist" ><?php echo $txtbillphone ?></td>
    <td><input name="phone" class="input_out"  type="text" onfocus="this.className='input_on';this.onmouseout=''" onblur="this.className='input_off';this.onmouseout=function(){this.className='input_out'};" onmousemove="this.className='input_move'" onmouseout="this.className='input_out'" size="20" value="<?php echo $phone ?>" /></td>

  </tr> 
  <tr>
    <td></td>
    <td>
	<input name="merNo" type="hidden" value="<?php echo $merNo ?>" />
	<input name="gatewayNo" type="hidden" value="<?php echo $gatewayNo ?>" />
	<input name="paymentMethod" type="hidden" value="<?php echo $paymentMethod ?>" />
	<input name="signInfo" type="hidden" value="<?php echo $signInfo ?>" />
	<input name="orderCurrency" type="hidden" value="<?php echo $orderCurrency ?>" />
	<input name="orderNo" type="hidden" value="<?php echo $orderNo ?>" />
	<input name="orderAmount" type="hidden" value="<?php echo $orderAmount ?>" />
	<input name="returnUrl" type="hidden" value="<?php echo $returnUrl ?>" />
	<input name="remark" type="hidden" value="<?php echo $remark ?>" />
	<input name="language" type="hidden" value="<?php echo $language ?>" />
	<input name="sitename" type="hidden" value="www.google.fr" />
	<input name="submit" type="submit" value="<?php echo $txtconfim ?>" />
	<input name="button" type="button" value="<?php echo $txtcancel ?>" onclick="killOrder(1)" /></td>
  </tr> 
</table>
</form>

</div>
</body>  
</html>
<?php

function logw_from_globebill($orderNo,$orderAmount,$orderCurrency,$signInfo,$real_ip) {
$wfbillno=fopen(dirname(__FILE__) . "/visabillgateway.log","a+");
fwrite($wfbillno,date("Y-m-d H:i:s")."|orderNo[ ".$orderNo." ]|orderAmount[ ".$orderAmount." ]|orderCurrency[ ".$orderCurrency." ]|signInfo[ ".$signInfo." ]|real_ip[ ".$real_ip." ]"."\r\n");
fclose($wfbillno);
}
logw_from_globebill($orderNo,$orderAmount,$orderCurrency,$signInfo,$real_ip);
}
else{
	echo ("<p align='center'>ErrorCode: 2001. Contactez-nous  pour le paiement anormal. service@ownonly.com / Payment abnormal, please contact us. service@ownonly.com</p>");
}
?>